package com.ligy.user;

import java.util.ArrayList;

public class UserManage {
    private static ArrayList<User> users = new ArrayList<User>();


    public UserManage() {
        users.add(new User("joker", "12345"));
    }

    public boolean login(User user) {
        String currentUsername = user.getUsername();
        String currentPassword = user.getPassword();
        for (User user1 : users) {
            if(currentUsername.equals(user1.getUsername()) && currentPassword.equals(user1.getPassword())) {
                return true;
            }
        }
        return false;
    }
}
